package com.heima.search.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.heima.model.search.pojo.SearchHistory;
import com.heima.model.search.dto.UserSearchDto;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface SearchService extends IService<SearchHistory> {
    void save(String map) throws IOException;

    /**
     * 文章搜索
     * @param dto
     * @return
     * @throws IOException
     */
    List<Map<String, Object>> search( UserSearchDto dto) throws IOException;

    /**
     * 历史搜索展示
     *
     * @param dto
     * @return
     * @throws IOException
     */
    List<SearchHistory> searchHistory(UserSearchDto dto);

    /**
     * 搜索自动补全
     *
     * @param dto
     * @return
     * @throws IOException
     */
    List<String> autoCompletion(UserSearchDto dto) throws IOException;
}
